﻿package 
{
	import flash.events.*;
	import flash.display.MovieClip;
	
	public class EventProc extends MovieClip{
		var s:Script=new Script();
		public function EventProc(mainRoot:Object){
			trace("EventProcCreated,"+mainRoot.numChildren);
			mainRoot.addEventListener(KeyboardEvent.KEY_DOWN,keyDownHandler);
			mainRoot.addEventListener(KeyboardEvent.KEY_UP,keyUpHandler);
		}
		function keyDownHandler(e:KeyboardEvent){
			s.keyDownProc(e);
			trace("EventDownProc OK");
		}
		function keyUpHandler(e:KeyboardEvent){
			s.keyUpProc(e);
			trace("EventUpProc OK")
		}
	}
}